Matplotlib exercise

  1. Line Plot
  2. Bar chart
  3. Bar chart - multiple inputs
  4. Bar chart - stacked
  5. Scatter plot data

In [4]:
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt

In [26]:
# Line Plot data
myArray = np.array([ 7,  8,  9, 10, 12, 13, 15, 16,
       17, 18, 20, 22, 23, 24, 25, 23, 22,  20, 19, 17, 16, 15, 13, 12, 11])


[23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11]

In [31]:
# Bar chart plot data
important = (0,0,4,3,10,21)
data_range = np.arange(6)

In [37]:
# Bar chart plot data - multiple inputs
important = (0,0,4,3,15,10)
current =(1,1,16,10,8,2)
N = 6

In [42]:
# Bar chart plot data stacked - multiple inputs
important = (3,0,4,7,16,8)
current =(0,4,16,11,5,2)
N = 6

In [1]:
# Scatter plot data
# Alligator data snout length and weight
alligatorLength = np.array([3.87, 3.61, 4.33, 3.43, 3.81, 3.83, 3.46, 3.76, 3.50, 3.58, 4.19, 3.78, 3.71, 3.73, 3.78])
alligatorWeight = np.array([4.87, 3.93, 6.46, 3.33, 4.38, 4.70, 3.50, 4.50, 3.58, 3.64, 5.90, 4.43, 4.38, 4.42, 4.25])

In [ ]: